{include file="public/_meta" /}
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 管理员管理 <span
        class="c-gray en">&gt;</span> 角色管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
        href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span></div>
    <input type="hidden" id="did" value="{$id}">

    <div class="mt-20">
        <table class="table table-border  table-hover table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th width="50">选择加盟店</th>
                <th width="200">ID</th>
                <th width="100">加盟店手机号</th>
                <th width="200">加盟店名称</th>
            </tr>
            </thead>
            <tbody>
            {volist name='list' id="vo"}
            <tr class="text-c">
                <td><input type="checkbox" value="" id="{$vo.id}" name="title"></td>
                <td>{$vo.us_account}</td>
                <td>{$vo.us_tel}</td>
                <td>{$vo.us_nickname}</td>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <button class="btn btn-info radius" id="btnOperate" onclick="static_num()">确认选择</button>
        <div class="pages" style="margin:20px;float: right; ">{$list|raw}</div>
    </div>
</div>
</body>
{include file="public/_footer" /}
<script>
    //复选框点击事件
    function static_num() {
        //     document.getElementById("btnOperate").onclick = function () {
        var did = $("#did").val();
        var arr = new Array();
        var items = document.getElementsByName("title");
        for (i = 0; i < items.length; i++) {
            if (items[i].checked) {
                arr.push(items[i].id);
            }
        }
        if (arr == '') {
            layer.msg('请选择加盟店ID');
            return false;
        }
        // alert(arr);
        // return false;

        $.ajax({
            type: "post",
            url: "{:url('user/getJoinId')}",
            data: {id: arr,did:did},
            success: function (data) {
                console.log(data);
                return false
                // layer.msg(data.msg);
                // if(data.code){
                //     setTimeout("window.location='';",1000);
                //     //location.href = '';
                // }

            }
        });
    }
</script>
